1. /* sdbcnstr.cpp by K.Tsuru */
  2. // function ID = 33
  3. /****************************
  4. SDouble class
  5. constructor with type and size
  6. *****************************/
  7. #ifndef SN_H
  8. #include "sn.h"
  9. #endif
  10. /**************************************************************************
  11. All the elements of figure[] are initialized by zero.
  12. Use for a valiable whose necessary size is known in advance to avoid the
  13. reallocations of memory which may yield "out of memory" error.
  14. ***************************************************************************/
  15. SDouble::SDouble(NumberType tp, uint vsz):SNumber(tp), rdxExp(0)
  16. {
  17. uint sz;
  18. if(tp == BIN_DEC) vsz = SNMaxSize(BIN_DEC);
  19. if(vsz == 0) return;
  20. sz = min(vsz, SNMaxSize(tp));
  21. if(sz > minArraySize) CutDown(DISABLE);
  22. valloc(sz, 0);
  23. if(tp == BIN_DEC) return;
  24. uchar cd = 0;
  25. if( (CutDown() == DISABLE) && (PushedCD() & PUSH) ){
  26. cd = PushedCD();
  27. cd |= SD_PUSH;
  28. }
  29. if( (sz > minArraySize) && (reduceMaxSize != DISABLE) ){
  30. /*
  31. In the Newton's method with "the method of doubling effective figures" SetEffFig()
  32. is used to tempolally reduce the effective figures, but it must not reduce the
  33. maximum size.
  34. */
  35. reduceMaxSize = DISABLE;
  36. cd |= REDUCE_MAX_SIZE_DISABLE;
  37. }
  38. if(cd) PushCD(cd);
  39. }

sdbcnstr.cpp : last modifiled at 2015/11/25 20:14:10(1,275 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).